package com.zzx.mapper;

import com.zzx.model.Employee;

import java.util.List;

//
//import org.apache.ibatis.annotations.Delete;
//import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
//import org.apache.ibatis.annotations.Select;
//import org.apache.ibatis.annotations.Update;

@Mapper
public interface EmployeeMapper {

	// @Select("select * from employee where id=5")
	public List<Employee> findAll();// List<String, Object>

	public List<Employee> findAllTwo();
	
	/**
	 * 1. 一个参数不做处理，#{任意}都可以获取参数 
	 * 2. 多个参数被封装成Map,key有一下两种#{arg0},#{param1} 都可以获取第一个参数
	 * 3. 使用命名参数@Param("id") Integer id 
	 * 4. 多个参数一般使用实体类-->#{属性名} 
	 * 5.如果没有对应的实体类则使用map封装多个参数-->#{key} Available parameters are [arg1, arg0, param1,
	 * param2] Boolean findById(Employee emp);
	 */
	// @Insert("insert into employee (u_name,u_phone,u_age)
	// values(#{name},#{phone},#{age})")
	public Boolean insert(Employee emp);

	// @Update("update employee set u_name=#{name},u_phone=#{phone},u_age=#{age}
	// where id=#{id}")
	public boolean update(Employee emp);

	// @Delete("delete from employee where id=#{id}")
	public boolean delete(Employee emp);

}
